package com.zingrow.web.configure.iformation.controller;

import java.util.ArrayList;
import java.util.List;
import java.util.regex.Pattern;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleIfStatement.Else;
import com.idaycrm.idaybase.utils.JsonUtils;
import com.zingrow.common.ReturnStandardDataFormat;
import com.zingrow.common.utils.CommonUtils;
import com.zingrow.common.utils.EncodingUtils;
import com.zingrow.common.utils.OptClass;
import com.zingrow.common.utils.PageView;
import com.zingrow.common.utils.StringUtil;
import com.zingrow.web.base.CodeMsg;
import com.zingrow.web.base.controller.BaseController;
import com.zingrow.web.base.enums.Menu;
import com.zingrow.web.base.enums.Operation;
import com.zingrow.web.configure.iformation.model.Iformation;
import com.zingrow.web.configure.iformation.service.IIformationService;
import com.zingrow.web.customer.controller.GroupController;
import com.zingrow.web.customer.model.GroupScheme;
import com.zingrow.web.customer.service.IGroupSchemeService;
import com.zingrow.web.customer.service.IGroupService;
import com.zingrow.web.customer.service.impl.GroupService;
import com.zingrow.web.report.model.RptModel;
import com.zingrow.web.report.model.RptModuleInfo;
import com.zingrow.web.report.service.IRptModuleService;
import com.zingrow.web.support.operate.model.OptRecord;
import com.zingrow.web.support.operate.service.IOptRecordService;
import com.zingrow.web.user.model.ActiveUser;
import com.zingrow.web.user.model.UserPermission;
import com.zingrow.web.user.service.IPermissionService;

@Controller
@RequestMapping(value = "/iformation/", produces = "application/json;charset=UTF-8")
public class IformationController extends BaseController {

	@Autowired
	private IIformationService iformationService;
	@Autowired
	private IOptRecordService optRecordService;
	@Autowired
	private IRptModuleService rptModuleService;
	@Autowired
	private IGroupSchemeService groupSchemeService;
	@Autowired
	private IPermissionService permissionService;
	@Autowired
	private IOptRecordService ioptRecordService;
	@Autowired
	private  IGroupService igroupService;
	
	

	// 正则验证，由数字，字母,中文,+,|,()符号等
	String pattern = "^[\u4e00-\u9fa5_a-zA-Z0-9+|()]+$";
	Pattern p = Pattern.compile(pattern);

	/**
	 * 分页模糊查询
	 * 
	 * @param httpRequest
	 * @param response
	 * @param pageIndex
	 * @param pageSize
	 * @param ifm_name
	 * @return
	 */
	@ResponseBody
	@RequestMapping("queryByParams")
	public String queryByParams(HttpServletRequest httpRequest, HttpServletResponse response, Integer pageIndex,
			Integer pageSize, String ifm_name, String ifm_note, Integer groupId, String ifm_isdelete,
			String ifm_categoryName) {
		List<Iformation> returnList = new ArrayList<Iformation>();
		ReturnStandardDataFormat standardData = new ReturnStandardDataFormat(CodeMsg.CODE_ERROR, CodeMsg.MSG_ERROR,
				returnList);
		PageView pageView = null;
		try {
			if (pageIndex == null || pageIndex <= 0) {
				pageIndex = 1;
			}
			if (pageSize == null || pageSize <= 0) {
				pageSize = 10;
			}

			pageView = new PageView(pageSize, pageIndex);
			// 中文转码
			if (ifm_name != null || "".equals(ifm_name)) {
				ifm_name = EncodingUtils.fixUrlParamEncoding(httpRequest, ifm_name);
			}
			if (ifm_note != null || "".equals(ifm_note)) {
				ifm_note = EncodingUtils.fixUrlParamEncoding(httpRequest, ifm_note);
			}
			if (ifm_categoryName != null || "".equals(ifm_categoryName)) {
				ifm_categoryName = EncodingUtils.fixUrlParamEncoding(httpRequest, ifm_categoryName);
			}

			
			
			returnList = iformationService.queryByParams(pageView, ifm_name, ifm_note, groupId, ifm_isdelete,
					ifm_categoryName);	
			//操作日志
			ActiveUser opuser = getUser(httpRequest);//获取操作用户
			String groupname=igroupService.selectGroupNameByGroupid(groupId);
			if("0".equals(ifm_isdelete))
				ifm_isdelete="关闭";
			else if("1".equals(ifm_isdelete))
				ifm_isdelete="开启";
			OptRecord s = new OptClass().messfim_query(opuser,Menu.ProgrammeManagement.toString(),
					Menu.Informationschemeconfiguration.toString(),Operation.query.toString(),ifm_name,ifm_note,groupname,ifm_isdelete,ifm_categoryName);
			if(s.getOptName()!="null")
			ioptRecordService.insert(s);
		} catch (Exception e) {
			log.error("根据参数查询发生异常");
			ActiveUser opuser = getUser(httpRequest);//获取操作用户
			OptRecord s = new OptClass().recordabnormality(opuser,"方案信息配置查询异常");
			ioptRecordService.insert(s);
			standardData.setReturnCode(CodeMsg.CODE_EXCEPTION);
			standardData.setReturnMessage(CodeMsg.MSG_EXCEPTION);
			standardData.setReturnData(returnList);
		}
		standardData.setReturnData(returnList);
		standardData.setReturnCode(CodeMsg.CODE_OK);
		standardData.setReturnMessage(CodeMsg.MSG_OK);
		standardData.setTotalPages(pageView.getPageCount());
		standardData.setTotalRecords(pageView.getRowCount());
		return JsonUtils.toString(standardData, "yyyy-MM-dd HH:mm:ss");
	}

	/*
	 * 判断 yzx
	 */
	@ResponseBody
	@RequestMapping("selectIfm_categoryNameByGroupId")
	public String selectIfm_categoryNameByGroupId(HttpServletRequest httpRequest, HttpServletResponse response,
			Integer groupId, String category) {
		Iformation iformation = null;
		ReturnStandardDataFormat standardData = new ReturnStandardDataFormat(CodeMsg.CODE_ERROR, CodeMsg.MSG_ERROR,
				iformation);
		try {
			// 判断参数合法性
			/*
			 * 通过组织ID和方案类别查询方案类别名称 如果存在将查询结果传给前台 不存在将将空传给前台 yzx
			 */
			if(category!=null||category.equals("")){
			if (iformationService.selectIfm_categoryNameByGroupId(groupId, category) != null) {
				iformation = iformationService.selectIfm_categoryNameByGroupId(groupId, category);
			} else {
				iformation = null;
			}
			}
		} catch (Exception e) {
			log.error("异常");
			log.error(e.getMessage());
			standardData.setReturnCode(CodeMsg.CODE_EXCEPTION);
			standardData.setReturnMessage(CodeMsg.MSG_EXCEPTION);
		}
		standardData.setReturnData(iformation);
		standardData.setReturnCode(CodeMsg.CODE_OK);
		standardData.setReturnMessage(CodeMsg.MSG_OK);
		return JsonUtils.toString(standardData, "yyyy-MM-dd HH:mm:ss");

	}

	/**
	 * 新增
	 * 
	 * @param httpRequest
	 * @param response
	 * @param iformation
	 * @return
	 */
	@ResponseBody
	@RequestMapping("addIformation")
	public String addIformation(HttpServletRequest httpRequest, HttpServletResponse response, Iformation iformation,
			Integer groupId, String ifm_category, String ifm_categoryName) {
		ReturnStandardDataFormat standardData = new ReturnStandardDataFormat(CodeMsg.CODE_ERROR, CodeMsg.MSG_ERROR,
				null);
		try {
			// 判断参数合法性
			if (CommonUtils.isStrNull(iformation.getIfm_name())) {
				standardData.setReturnCode(CodeMsg.CODE_ERROR_PARAMS);
				standardData.setReturnMessage(CodeMsg.MSG_ERROR_PARAMS);
				return JsonUtils.toString(standardData, "yyyy-MM-dd HH:mm:ss");
			}
			// 中文转码
			if (iformation.getIfm_name() != null && !iformation.getIfm_name().equals("")) {
				iformation.setIfm_name(EncodingUtils.fixUrlParamEncoding(httpRequest, iformation.getIfm_name()));
			}
			if (iformation.getIfm_note() != null && !iformation.getIfm_note().equals("")) {
				iformation.setIfm_note(EncodingUtils.fixUrlParamEncoding(httpRequest, iformation.getIfm_note()));
			}
			if (iformation.getIfm_type() != null && !iformation.getIfm_type().equals("")) {
				iformation.setIfm_type(EncodingUtils.fixUrlParamEncoding(httpRequest, iformation.getIfm_type()));
			}
			if (iformation.getIfm_category() != null && !iformation.getIfm_category().equals("")) {
				iformation
						.setIfm_category(EncodingUtils.fixUrlParamEncoding(httpRequest, iformation.getIfm_category()));
			}
			if (iformation.getIfm_categoryName() != null && !iformation.getIfm_categoryName().equals("")) {
				iformation.setIfm_categoryName(
						EncodingUtils.fixUrlParamEncoding(httpRequest, iformation.getIfm_categoryName()));
			}
			if (null != iformation.getIfm_getChannel() && !iformation.getIfm_getChannel().equals("")) {
				iformation.setIfm_getChannel(
						EncodingUtils.fixUrlParamEncoding(httpRequest, iformation.getIfm_getChannel()));
			}
			if (null != iformation.getIfm_notChannel() && !iformation.getIfm_notChannel().equals("")) {
				iformation.setIfm_notChannel(
						EncodingUtils.fixUrlParamEncoding(httpRequest, iformation.getIfm_notChannel()));
			}
			if (null != iformation.getIfm_getWechatId() && !iformation.getIfm_getWechatId().equals("")) {
				iformation.setIfm_getWechatId(
						EncodingUtils.fixUrlParamEncoding(httpRequest, iformation.getIfm_getWechatId()));
			}
			if (null != iformation.getIfm_notWechatId() && !iformation.getIfm_notWechatId().equals("")) {
				iformation.setIfm_notWechatId(
						EncodingUtils.fixUrlParamEncoding(httpRequest, iformation.getIfm_notWechatId()));
			}
			if (null != iformation.getIfm_getBloggerId() && !iformation.getIfm_getBloggerId().equals("")) {
				iformation.setIfm_getBloggerId(
						EncodingUtils.fixUrlParamEncoding(httpRequest, iformation.getIfm_getBloggerId()));
			}
			if (null != iformation.getIfm_notBloggerId() && !iformation.getIfm_notBloggerId().equals("")) {
				iformation.setIfm_notBloggerId(
						EncodingUtils.fixUrlParamEncoding(httpRequest, iformation.getIfm_notBloggerId()));
			}
			if (null != iformation.getIfm_getBbsName() && !iformation.getIfm_getBbsName().equals("")) {
				iformation.setIfm_getBbsName(
						EncodingUtils.fixUrlParamEncoding(httpRequest, iformation.getIfm_getBbsName()));
			}
			if (iformation.getIfm_notBbsName() != null && !iformation.getIfm_notBbsName().equals("")) {
				iformation.setIfm_notBbsName(
						EncodingUtils.fixUrlParamEncoding(httpRequest, iformation.getIfm_notBbsName()));
			}
			if (null != iformation.getIfm_getKeyword() && !iformation.getIfm_getKeyword().equals("")) {
				iformation.setIfm_getKeyword(
						EncodingUtils.fixUrlParamEncoding(httpRequest, iformation.getIfm_getKeyword()));
			}
			if (null != iformation.getIfm_notKeyword() && !iformation.getIfm_notKeyword().equals("")) {
				iformation.setIfm_notKeyword(
						EncodingUtils.fixUrlParamEncoding(httpRequest, iformation.getIfm_notKeyword()));
			}
			if (null != iformation.getIfm_filterPattern() && !iformation.getIfm_filterPattern().equals("")) {
				iformation.setIfm_filterPattern(
						EncodingUtils.fixUrlParamEncoding(httpRequest, iformation.getIfm_filterPattern()));
			}
			if (null != iformation.getIfm_matePattern() && !iformation.getIfm_matePattern().equals("")) {
				iformation.setIfm_matePattern(
						EncodingUtils.fixUrlParamEncoding(httpRequest, iformation.getIfm_matePattern()));
			}
			// 判断关键词是否为空
			/*
			 * if (iformation.getIfm_getKeyword()!=null&&iformation.
			 * getIfm_getKeyword()!="" ||
			 * iformation.getIfm_notKeyword()!=null&&iformation.
			 * getIfm_notKeyword()!=""){ String str =
			 * iformation.getIfm_getKeyword(); String str2 =
			 * iformation.getIfm_notKeyword(); //中文括号替换成英文括号 //str =
			 * str.replaceAll("（", "(").replace("）", ")"); Matcher m =
			 * p.matcher(str); Matcher m1 = p.matcher(str2); if (!m.matches()){
			 * standardData.setReturnCode(CodeMsg.CODE_EXCEPTION);
			 * standardData.setReturnMessage("匹配关键词含有非法字符"); return
			 * JsonUtils.toString(standardData, "yyyy-MM-dd HH:mm:ss"); }else if
			 * (!m1.matches()){
			 * standardData.setReturnCode(CodeMsg.CODE_EXCEPTION);
			 * standardData.setReturnMessage("过滤关键词含有非法字符"); return
			 * JsonUtils.toString(standardData, "yyyy-MM-dd HH:mm:ss"); } }
			 */
			// 判断频道资源
			if (null == iformation.getIfm_getChannel() || iformation.getIfm_getChannel().equals("")) {
				iformation.setIfm_getChannel("None");
			} else if (!iformation.getIfm_getChannel().equals("None")) {
				// 频道资源两个字段，其中一个有值，另一个赋值为None
				iformation.setIfm_notChannel("None");
			}
			if (null == iformation.getIfm_notChannel() || iformation.getIfm_notChannel().equals("")) {
				iformation.setIfm_notChannel("None");
			} else if (!iformation.getIfm_notChannel().equals("None")) {
				// 频道名称资源两个字段，其中一个有值，另一个赋值为None
				iformation.setIfm_getChannel("None");
			}

			// 判断微信资源
			if (null == iformation.getIfm_getWechatId() || iformation.getIfm_getWechatId().equals("")) {
				iformation.setIfm_getWechatId("None");
			} else if (!iformation.getIfm_getWechatId().equals("None")) {
				// 微信业务id资源两个字段，其中一个有值，另一个赋值为None
				iformation.setIfm_notWechatId("None");
			}
			if (null == iformation.getIfm_notWechatId() || iformation.getIfm_notWechatId().equals("")) {
				iformation.setIfm_notWechatId("None");
			} else if (!iformation.getIfm_notWechatId().equals("None")) {
				// 微信业务id资源两个字段，其中一个有值，另一个赋值为None
				iformation.setIfm_getWechatId("None");
			}
			// 判断微博资源
			if (null == iformation.getIfm_getBloggerId() || iformation.getIfm_getBloggerId().equals("")) {
				iformation.setIfm_getBloggerId("None");
			} else if (!iformation.getIfm_getBloggerId().equals("None")) {
				// 微博名称资源两个字段，其中一个有值，另一个赋值为None
				iformation.setIfm_notBloggerId("None");
			}
			if (null == iformation.getIfm_notBloggerId() || iformation.getIfm_notBloggerId().equals("")) {
				iformation.setIfm_notBloggerId("None");
			} else if (!iformation.getIfm_notBloggerId().equals("None")) {
				// 微博名称资源两个字段，其中一个有值，另一个赋值为None
				iformation.setIfm_getBloggerId("None");
			}

			// 判断论坛资源
			if (null == iformation.getIfm_getBbsName() || iformation.getIfm_getBbsName().equals("")) {
				iformation.setIfm_getBbsName("None");
			} else if (!iformation.getIfm_getBbsName().equals("None")) {
				// 论坛名称资源两个字段，其中一个有值，另一个赋值为None
				iformation.setIfm_notBbsName("None");
			}
			if (null == iformation.getIfm_notBbsName() || iformation.getIfm_notBbsName().equals("")) {
				iformation.setIfm_notBbsName("None");
			} else if (!iformation.getIfm_notBbsName().equals("None")) {
				// 论坛名称资源两个字段，其中一个有值，另一个赋值为None
				iformation.setIfm_getBbsName("None");
			}

			// 判断关键词
			if (null == iformation.getIfm_getKeyword() || iformation.getIfm_getKeyword().equals("")) {
				iformation.setIfm_getKeyword("None");
			}
			if (null == iformation.getIfm_notKeyword() || iformation.getIfm_notKeyword().equals("")) {
				iformation.setIfm_notKeyword("None");
			}
			if (StringUtils.isNoneBlank(iformation.getIfm_getKeyword())) {
				char[] ifm_getKeyword = iformation.getIfm_getKeyword().toCharArray();
				if (!StringUtil.isBracke(ifm_getKeyword)) {
					standardData.setReturnMessage("请检查括号是否完整！");
					return JsonUtils.toString(standardData, "yyyy-MM-dd HH:mm:ss");
				}
			}
			if (StringUtils.isNoneBlank(iformation.getIfm_notKeyword())) {
				char[] ifm_notKeyword = iformation.getIfm_notKeyword().toCharArray();
				if (!StringUtil.isBracke(ifm_notKeyword)) {
					standardData.setReturnMessage("请检查括号是否完整！");
					return JsonUtils.toString(standardData, "yyyy-MM-dd HH:mm:ss");
				}
			}

			// 查询组织下所有类别名称
			int sum = 0;
			List<Iformation> list = new ArrayList<Iformation>();
			list = iformationService.selectCategoryNameByGroupid(iformation.getGroupId());
			/*
			 * 页面提交的类别名称与查询出来的对比，没有相同s赋值为0 找到赋值为1
			 */
			for (int i = 0; i < list.size(); i++) {
				int s;
				if (!list.get(i).getIfm_categoryName().equals(iformation.getIfm_categoryName()) || (iformationService
						.selectNameBycategory(list.get(i)).getIfm_category().equals(iformation.getIfm_category())
						&& list.get(i).getIfm_categoryName().equals(iformation.getIfm_categoryName()))) {
					s = 0;
				} else {
					s = 1;
				}
				sum += s;
			}
			if (sum == 0) {
				/*
				 * 对比完之后sum=0 调用新增方法
				 */
				if (iformationService.addIformation(iformation)) {
					standardData.setReturnCode(CodeMsg.CODE_OK);
					standardData.setReturnMessage(CodeMsg.MSG_OK);
					// 判断方案是否选择了组织
					if (groupId != null) {
						// 根据信息查询当前新增方案ID
						Iformation sa = iformationService.selectbyname(iformation.getIfm_name(),
								iformation.getIfm_note(), iformation.getIfm_getKeyword());
						// 使当前组织与新增方案关联
						GroupScheme groupScheme = new GroupScheme();
						groupScheme.setGroupId(groupId);
						groupScheme.setIfmId(sa.getIfm_id());
						groupScheme.setIfmIsSensitivity(0);// 默认为非敏感
						groupScheme.setIfmcategory(ifm_category);
						groupScheme.setIfmcategoryName(ifm_categoryName);
						groupSchemeService.insertmg(groupScheme);
						// 新增一条操作记录
						ActiveUser opuser = getUser(httpRequest);//获取操作用户
						OptRecord s = new OptClass().messfim_add(opuser,Menu.ProgrammeManagement.toString(),
								Menu.Informationschemeconfiguration.toString(),Operation.insert.toString(),iformation.getIfm_name(),iformation.getIfm_note());
						if(s.getOptName()!="null")
						ioptRecordService.insert(s);
						standardData.setReturnCode(CodeMsg.CODE_OK);
						standardData.setReturnMessage(CodeMsg.MSG_OK);
					}
					else{
						ActiveUser opuser = getUser(httpRequest);//获取操作用户
						OptRecord s = new OptClass().messfim_add(opuser,Menu.ProgrammeManagement.toString(),
								Menu.Informationschemeconfiguration.toString(),Operation.insert.toString(),iformation.getIfm_name(),iformation.getIfm_note());
						if(s.getOptName()!="null")
						ioptRecordService.insert(s);
					}
				} else {
				
					standardData.setReturnCode(CodeMsg.CODE_ERROR);
					standardData.setReturnMessage(CodeMsg.MSG_ERROR);
				}
			}
			else{
				standardData.setReturnCode(CodeMsg.CODE_ERROR_OTHER);
				standardData.setReturnMessage("同一组织下该类别名称在其他类别下已存在");
			}
			
		} catch (Exception e) {
			log.error("新增方案异常");
			ActiveUser opuser = getUser(httpRequest);//获取操作用户
			OptRecord s = new OptClass().recordabnormality(opuser,"方案信息管理新增异常");
			ioptRecordService.insert(s);
			standardData.setReturnCode(CodeMsg.CODE_EXCEPTION);
			standardData.setReturnMessage(CodeMsg.MSG_EXCEPTION);
		}
		return JsonUtils.toString(standardData, "yyyy-MM-dd HH:mm:ss");
	}

	/**
	 * 单个查询2
	 * 
	 * @param httpRequest
	 * @param response
	 * @param ifm_id
	 * @param groupId
	 * @return
	 */
	@ResponseBody
	@RequestMapping("queryByID2")
	public String queryByID(HttpServletRequest httpRequest, HttpServletResponse response, Integer ifm_id,
			Integer groupId) {
		Iformation iformation = null;
		ReturnStandardDataFormat standardData = new ReturnStandardDataFormat(CodeMsg.CODE_ERROR, CodeMsg.MSG_ERROR,
				iformation);
		try {
			if (CommonUtils.isObjectNull(ifm_id)) {
				standardData.setReturnCode(CodeMsg.CODE_ERROR_PARAMS);
				standardData.setReturnMessage(CodeMsg.MSG_ERROR_PARAMS);
				return JsonUtils.toString(standardData, "yyyy-MM-dd HH:mm:ss");
			}
			iformation = iformationService.queryByID2(ifm_id, groupId);
			if (iformationService.queryByID2(ifm_id, groupId) != null) {
				standardData.setReturnData(iformation);
				standardData.setReturnCode(CodeMsg.CODE_OK);
				standardData.setReturnMessage(CodeMsg.MSG_OK);
			} else {
				standardData.setReturnCode(CodeMsg.CODE_ERROR);
				standardData.setReturnMessage(CodeMsg.MSG_ERROR);
			}

		} catch (Exception e) {
			log.error("查询方案异常");
			log.error(e.getMessage());
			standardData.setReturnCode(CodeMsg.CODE_EXCEPTION);
			standardData.setReturnMessage(CodeMsg.MSG_EXCEPTION);
			standardData.setReturnData(iformation);
		}
		return JsonUtils.toString(standardData, "yyyy-MM-dd HH:mm:ss");
	}

	/**
	 * 修改
	 * 
	 * @param httpRequest
	 * @param response
	 * @param iformation
	 * @return
	 */
	@ResponseBody
	@RequestMapping("modifyIformation")
	public String modifyIformation(HttpServletRequest httpRequest, HttpServletResponse response, Iformation iformation,
			String oldCategory, String oldCategoryName,String discern) {
		ReturnStandardDataFormat standardData = new ReturnStandardDataFormat(CodeMsg.CODE_ERROR, CodeMsg.MSG_ERROR,
				null);
		try {
			if (CommonUtils.isStrNull(iformation.getIfm_name())) {
				standardData.setReturnCode(CodeMsg.CODE_ERROR_PARAMS);
				standardData.setReturnMessage(CodeMsg.MSG_ERROR_PARAMS);
				return JsonUtils.toString(standardData, "yyyy-MM-dd HH:mm:ss");
			}
			// 中文转码
			if (null != iformation.getIfm_name() && !iformation.getIfm_name().equals("")) {
				iformation.setIfm_name(EncodingUtils.fixUrlParamEncoding(httpRequest, iformation.getIfm_name()));
			}
			if (null != iformation.getIfm_note() && !iformation.getIfm_note().equals("")) {
				iformation.setIfm_note(EncodingUtils.fixUrlParamEncoding(httpRequest, iformation.getIfm_note()));
			}
			if (null != iformation.getIfm_category() && !iformation.getIfm_category().equals("")) {
				iformation
						.setIfm_category(EncodingUtils.fixUrlParamEncoding(httpRequest, iformation.getIfm_category()));
			}
			if (null != iformation.getIfm_categoryName() && !iformation.getIfm_categoryName().equals("")) {
				iformation.setIfm_categoryName(
						EncodingUtils.fixUrlParamEncoding(httpRequest, iformation.getIfm_categoryName()));
			}
			if (null != iformation.getGroupId() && !iformation.getGroupId().equals("")) {
				iformation.setGroupId(iformation.getGroupId());
			}
			if (null != iformation.getIfm_type() && !iformation.getIfm_type().equals("")) {
				iformation.setIfm_type(EncodingUtils.fixUrlParamEncoding(httpRequest, iformation.getIfm_type()));
			}
			if (null != iformation.getIfm_getChannel() && !iformation.getIfm_getChannel().equals("")) {
				iformation.setIfm_getChannel(
						EncodingUtils.fixUrlParamEncoding(httpRequest, iformation.getIfm_getChannel()));
			}
			if (null != iformation.getIfm_notChannel() && !iformation.getIfm_notChannel().equals("")) {
				iformation.setIfm_notChannel(
						EncodingUtils.fixUrlParamEncoding(httpRequest, iformation.getIfm_notChannel()));
			}
			if (null != iformation.getIfm_getWechatId() && !iformation.getIfm_getWechatId().equals("")) {
				iformation.setIfm_getWechatId(
						EncodingUtils.fixUrlParamEncoding(httpRequest, iformation.getIfm_getWechatId()));
			}
			if (null != iformation.getIfm_notWechatId() && !iformation.getIfm_notWechatId().equals("")) {
				iformation.setIfm_notWechatId(
						EncodingUtils.fixUrlParamEncoding(httpRequest, iformation.getIfm_notWechatId()));
			}
			if (null != iformation.getIfm_getBloggerId() && !iformation.getIfm_getBloggerId().equals("")) {
				iformation.setIfm_getBloggerId(
						EncodingUtils.fixUrlParamEncoding(httpRequest, iformation.getIfm_getBloggerId()));
			}
			if (null != iformation.getIfm_notBloggerId() && !iformation.getIfm_notBloggerId().equals("")) {
				iformation.setIfm_notBloggerId(
						EncodingUtils.fixUrlParamEncoding(httpRequest, iformation.getIfm_notBloggerId()));
			}
			if (null != iformation.getIfm_getBbsName() && !iformation.getIfm_getBbsName().equals("")) {
				iformation.setIfm_getBbsName(
						EncodingUtils.fixUrlParamEncoding(httpRequest, iformation.getIfm_getBbsName()));
			}
			if (iformation.getIfm_notBbsName() != null && !iformation.getIfm_notBbsName().equals("")) {
				iformation.setIfm_notBbsName(
						EncodingUtils.fixUrlParamEncoding(httpRequest, iformation.getIfm_notBbsName()));
			}
			if (null != iformation.getIfm_getKeyword() && !iformation.getIfm_getKeyword().equals("")) {
				iformation.setIfm_getKeyword(
						EncodingUtils.fixUrlParamEncoding(httpRequest, iformation.getIfm_getKeyword()));
			}
			if (null != iformation.getIfm_notKeyword() && !iformation.getIfm_notKeyword().equals("")) {
				iformation.setIfm_notKeyword(
						EncodingUtils.fixUrlParamEncoding(httpRequest, iformation.getIfm_notKeyword()));
			}
			if (null != iformation.getIfm_filterPattern() && !iformation.getIfm_filterPattern().equals("")) {
				iformation.setIfm_filterPattern(
						EncodingUtils.fixUrlParamEncoding(httpRequest, iformation.getIfm_filterPattern()));
			}
			if (null != iformation.getIfm_matePattern() && !iformation.getIfm_matePattern().equals("")) {
				iformation.setIfm_matePattern(
						EncodingUtils.fixUrlParamEncoding(httpRequest, iformation.getIfm_matePattern()));
			}
			Iformation iformation2=iformationService.queryByID(iformation.getIfm_id());
			
			
			// 判断关键词是否为空
			/*
			 * if (iformation.getIfm_getKeyword()!=null&&iformation.
			 * getIfm_getKeyword()!="" ||
			 * iformation.getIfm_notKeyword()!=null&&iformation.
			 * getIfm_notKeyword()!=""){ String str =
			 * iformation.getIfm_getKeyword(); String str2 =
			 * iformation.getIfm_notKeyword(); //中文括号替换成英文括号 //str =
			 * str.replaceAll("（", "(").replace("）", ")"); Matcher m =
			 * p.matcher(str); Matcher m1 = p.matcher(str2); if (!m.matches()){
			 * standardData.setReturnCode(CodeMsg.CODE_EXCEPTION);
			 * standardData.setReturnMessage("匹配关键词含有非法字符"); return
			 * JsonUtils.toString(standardData, "yyyy-MM-dd HH:mm:ss"); }else if
			 * (!m1.matches()){
			 * standardData.setReturnCode(CodeMsg.CODE_EXCEPTION);
			 * standardData.setReturnMessage("过滤关键词含有非法字符"); return
			 * JsonUtils.toString(standardData, "yyyy-MM-dd HH:mm:ss"); } }
			 */
			// 判断频道资源
			if (null == iformation.getIfm_getChannel() || iformation.getIfm_getChannel().equals("")) {
				iformation.setIfm_getChannel("None");
			} else if (!iformation.getIfm_getChannel().equals("None")) {
				// 频道资源两个字段，其中一个有值，另一个赋值为None
				iformation.setIfm_notChannel("None");
			}
			if (null == iformation.getIfm_notChannel() || iformation.getIfm_notChannel().equals("")) {
				iformation.setIfm_notChannel("None");
			} else if (!iformation.getIfm_notChannel().equals("None")) {
				// 频道名称资源两个字段，其中一个有值，另一个赋值为None
				iformation.setIfm_getChannel("None");
			}

			// 判断微信资源
			if (null == iformation.getIfm_getWechatId() || iformation.getIfm_getWechatId().equals("")) {
				iformation.setIfm_getWechatId("None");
			} else if (!iformation.getIfm_getWechatId().equals("None")) {
				// 微信业务id资源两个字段，其中一个有值，另一个赋值为None
				iformation.setIfm_notWechatId("None");
			}
			if (null == iformation.getIfm_notWechatId() || iformation.getIfm_notWechatId().equals("")) {
				iformation.setIfm_notWechatId("None");
			} else if (!iformation.getIfm_notWechatId().equals("None")) {
				// 微信业务id资源两个字段，其中一个有值，另一个赋值为None
				iformation.setIfm_getWechatId("None");
			}

			// 判断微博资源
			if (null == iformation.getIfm_getBloggerId() || iformation.getIfm_getBloggerId().equals("")) {
				iformation.setIfm_getBloggerId("None");
			} else if (!iformation.getIfm_getBloggerId().equals("None")) {
				// 微博名称资源两个字段，其中一个有值，另一个赋值为None
				iformation.setIfm_notBloggerId("None");
			}
			if (null == iformation.getIfm_notBloggerId() || iformation.getIfm_notBloggerId().equals("")) {
				iformation.setIfm_notBloggerId("None");
			} else if (!iformation.getIfm_notBloggerId().equals("None")) {
				// 微博名称资源两个字段，其中一个有值，另一个赋值为None
				iformation.setIfm_getBloggerId("None");
			}

			// 判断论坛资源
			if (null == iformation.getIfm_getBbsName() || iformation.getIfm_getBbsName().equals("")) {
				iformation.setIfm_getBbsName("None");
			} else if (!iformation.getIfm_getBbsName().equals("None")) {
				// 论坛名称资源两个字段，其中一个有值，另一个赋值为None
				iformation.setIfm_notBbsName("None");
			}
			if (null == iformation.getIfm_notBbsName() || iformation.getIfm_notBbsName().equals("")) {
				iformation.setIfm_notBbsName("None");
			} else if (!iformation.getIfm_notBbsName().equals("None")) {
				// 论坛名称资源两个字段，其中一个有值，另一个赋值为None
				iformation.setIfm_getBbsName("None");
			}

			// 判断关键词
			if (null == iformation.getIfm_getKeyword() || iformation.getIfm_getKeyword().equals("")) {
				iformation.setIfm_getKeyword("None");
			}
			if (null == iformation.getIfm_notKeyword() || iformation.getIfm_notKeyword().equals("")) {
				iformation.setIfm_notKeyword("None");
			}
			if (StringUtils.isNoneBlank(iformation.getIfm_getKeyword())) {
				char[] ifm_getKeyword = iformation.getIfm_getKeyword().toCharArray();
				if (!StringUtil.isBracke(ifm_getKeyword)) {
					standardData.setReturnMessage("请检查括号是否完整！");
					return JsonUtils.toString(standardData, "yyyy-MM-dd HH:mm:ss");
				}
			}
			if (StringUtils.isNoneBlank(iformation.getIfm_notKeyword())) {
				char[] ifm_notKeyword = iformation.getIfm_notKeyword().toCharArray();
				if (!StringUtil.isBracke(ifm_notKeyword)) {
					standardData.setReturnMessage("请检查括号是否完整！");
					return JsonUtils.toString(standardData, "yyyy-MM-dd HH:mm:ss");
				}
			}
			// 判断同名
			/*
			 * if
			 * (iformationService.querySameByifmName(iformation.getIfm_name(),
			 * iformation.getIfm_id())) {
			 * standardData.setReturnCode(CodeMsg.CODE_ERROR_OTHER);
			 * standardData.setReturnMessage("修改失败,已存在其他同名方案！"); return
			 * JsonUtils.toString(standardData, "yyyy-MM-dd HH:mm:ss"); }
			 */

			// 方案关联了组织的情况
			if (null != iformation.getIfm_category() && !iformation.getIfm_category().equals("")) {

				// 判断是否对方案的类别与类别名称做了修改
				if (!iformation.getIfm_categoryName().equals(oldCategoryName)
						|| !iformation.getIfm_category().equals(oldCategory)) {
					// 第一种情况只修改类别名称
					if (!iformation.getIfm_categoryName().equals(oldCategoryName)
							&& iformation.getIfm_category().equals(oldCategory)) {
						int sum = 0;
						int s = 0;
						List<Iformation> list = new ArrayList<Iformation>();
						list = iformationService.selectCategoryNameByGroupid(iformation.getGroupId());
						/*
						 * 页面提交的类别名称与查询出来的对比，没有相同s赋值为0 找到赋值为1
						 */
						for (int i = 0; i < list.size(); i++) {
							if (!list.get(i).getIfm_categoryName().equals(iformation.getIfm_categoryName())) {
								s = 0;
							} else {
								s = 1;
							}
							sum += s;
						}
						if (sum == 0) {
							if (iformationService.modifyIformation(iformation)
									&& iformationService.modifyIformation2(iformation, oldCategory)) {		
								//添加操作记录
								ActiveUser opuser = getUser(httpRequest);//获取操作用户
								OptRecord sk = new OptClass().messfim_update(iformation,iformation2,opuser,Menu.ProgrammeManagement.toString(),
										Menu.Informationschemeconfiguration.toString(),Operation.bianjiin.toString(),oldCategory,oldCategoryName);
								if(sk.getOptName()!="null")
								ioptRecordService.insert(sk);
								standardData.setReturnCode(CodeMsg.CODE_OK);
								standardData.setReturnMessage(CodeMsg.MSG_OK);
							} else {
								standardData.setReturnCode(CodeMsg.CODE_ERROR);
								standardData.setReturnMessage(CodeMsg.MSG_ERROR);
							}
						} else {
							standardData.setReturnCode(CodeMsg.CODE_ERROR_OTHER);
							standardData.setReturnMessage("同一组织下该类别名称在其他类别下已存在");

						}
					}
					// 第二种情况，类别与类别名称都修改
					else {
						// 查询组织下所有类别名称
						int sum = 0;
						int s = 0;
						List<Iformation> list = new ArrayList<Iformation>();
						list = iformationService.selectCategoryNameByGroupid(iformation.getGroupId());
						/*
						 * 页面提交的类别名称与查询出来的对比，没有相同s赋值为0 找到赋值为1
						 */
						for (int i = 0; i < list.size(); i++) {
							if (!list.get(i).getIfm_categoryName().equals(iformation.getIfm_categoryName())
									|| (iformationService.selectNameBycategory(list.get(i)).getIfm_category()
											.equals(iformation.getIfm_category())
											&& list.get(i).getIfm_categoryName()
													.equals(iformation.getIfm_categoryName()))) {
								s = 0;
							} else {
								s = 1;
							}
							sum += s;
						}
						if (sum == 0) {
							if (iformationService.modifyIformation(iformation)
									&& iformationService.modifyIformation4(iformation, oldCategory)
									&& iformationService.modifyIformation2(iformation, oldCategory)) {
								//添加操作记录
								ActiveUser opuser = getUser(httpRequest);//获取操作用户
								OptRecord sk = new OptClass().messfim_update(iformation,iformation2,opuser,Menu.ProgrammeManagement.toString(),
										Menu.Informationschemeconfiguration.toString(),Operation.bianjiin.toString(),oldCategory,oldCategoryName);
								if(sk.getOptName()!="null")
								ioptRecordService.insert(sk);
								standardData.setReturnCode(CodeMsg.CODE_OK);
								standardData.setReturnMessage(CodeMsg.MSG_OK);
							} else {
								standardData.setReturnCode(CodeMsg.CODE_ERROR);
								standardData.setReturnMessage(CodeMsg.MSG_ERROR);
							}
						}
						else{
							standardData.setReturnCode(CodeMsg.CODE_ERROR_OTHER);
							standardData.setReturnMessage("同一组织下该类别名称在其他类别下已存在");

						}
					}
				} else {
					// 进入修改页面未修改类别与类别名称
					if (iformationService.modifyIformation(iformation)
							&& iformationService.modifyIformation2(iformation, oldCategory)) {
						//添加操作记录
						ActiveUser opuser = getUser(httpRequest);//获取操作用户
						OptRecord s = new OptClass().messfim_update(iformation,iformation2,opuser,Menu.ProgrammeManagement.toString(),
								Menu.Informationschemeconfiguration.toString(),Operation.bianjiin.toString(),null,null);
						if(s.getOptName()!="null")
						ioptRecordService.insert(s);
						standardData.setReturnCode(CodeMsg.CODE_OK);
						standardData.setReturnMessage(CodeMsg.MSG_OK);
					} else {
						standardData.setReturnCode(CodeMsg.CODE_ERROR);
						standardData.setReturnMessage(CodeMsg.MSG_ERROR);
					}
				}

			} else {
				// 新增方案没有关联了组织的情况
				if (iformationService.modifyIformation(iformation)) {
					//添加操作记录
					ActiveUser opuser = getUser(httpRequest);//获取操作用户
					OptRecord s = new OptClass().messfim_update(iformation,iformation2,opuser,Menu.ProgrammeManagement.toString(),
							Menu.Informationschemeconfiguration.toString(),Operation.bianjiin.toString(),null,null);
					if(s.getOptName()!="null")
					ioptRecordService.insert(s);
					standardData.setReturnCode(CodeMsg.CODE_OK);
					standardData.setReturnMessage(CodeMsg.MSG_OK);
				} else {
					standardData.setReturnCode(CodeMsg.CODE_ERROR);
					standardData.setReturnMessage(CodeMsg.MSG_ERROR);
				}
			}
			// }
			//新增操作日志
		
			ActiveUser opuser = getUser(httpRequest);//获取操作用户
			if("1".equals(discern)){
			OptRecord s = new OptClass().messfim_zhiyuanbj(iformation,iformation2,opuser,Menu.ProgrammeManagement.toString(),
					Menu.Informationschemeconfiguration.toString(),Operation.bianjiinzy.toString());
			if(s.getOptName()!="null")
			ioptRecordService.insert(s);}
			if("2".equals(discern)){
			OptRecord s = new OptClass().messfim_guanjianbj(iformation,iformation2,opuser,Menu.ProgrammeManagement.toString(),
					Menu.Informationschemeconfiguration.toString(),Operation.bianjiingj.toString());
			if(s.getOptName()!="null")
			ioptRecordService.insert(s);}
			if("3".equals(discern)){
				OptRecord s = new OptClass().messfim_gonot(iformation,iformation2,opuser,Menu.ProgrammeManagement.toString(),
						Menu.Informationschemeconfiguration.toString(),Operation.bianjiinzt.toString());
				if(s.getOptName()!="null")
				ioptRecordService.insert(s);}
		} catch (Exception e) {
			log.error("修改方案异常");
			ActiveUser opuser = getUser(httpRequest);//获取操作用户
			OptRecord s = new OptClass().recordabnormality(opuser,"修改信息方案异常");
			ioptRecordService.insert(s);
			standardData.setReturnCode(CodeMsg.CODE_EXCEPTION);
			standardData.setReturnMessage(CodeMsg.MSG_EXCEPTION);
		}
		return JsonUtils.toString(standardData, "yyyy-MM-dd HH:mm:ss");
	}

	@ResponseBody
	@RequestMapping("selectModel")
	public String selectModel(HttpServletRequest httpRequest, HttpServletResponse response, Integer ifm_id) {
		ReturnStandardDataFormat standardData = new ReturnStandardDataFormat(CodeMsg.CODE_ERROR, CodeMsg.MSG_ERROR,
				null);
		try {
			if (null == ifm_id) {
				standardData.setReturnCode(CodeMsg.CODE_ERROR_PARAMS);
				standardData.setReturnMessage(CodeMsg.MSG_ERROR_PARAMS);
				return JsonUtils.toString(standardData, "yyyy-MM-dd HH:mm:ss");
			}
			// 查询该方案是否被报告模板使用，如果被使用提示
			List<RptModuleInfo> modulelist = rptModuleService.selectByplanId(ifm_id);
			List<String> modelname = new ArrayList<String>(); // 创建集合放模板名称
			String name = null; // 创建string放模板名称
			RptModel model = new RptModel(); // 创建参数对象
			model.setIsOpen(0); // 添加参数
			if (modulelist.size() > 0) {
				for (int i = 0; i < modulelist.size(); i++) {
					if (null != modulelist.get(i).getName()) {
						modelname.add(modulelist.get(i).getName());
					}
				}
				name = StringUtil.toStringjoin(modelname);

				standardData.setReturnData(modulelist.size());
				standardData.setReturnCode(CodeMsg.CODE_OK);
				standardData.setReturnMessage("该方案已被报告模板\"" + name + "\"使用,是否去报告模板列表页解绑方案");
			} else {
				standardData.setReturnData(modulelist.size());
				standardData.setReturnCode(CodeMsg.CODE_OK);
				standardData.setReturnMessage(CodeMsg.MSG_OK);
			}
		} catch (Exception e) {
			log.error("删除异常");
			log.error(e.getMessage());
			standardData.setReturnCode(CodeMsg.CODE_EXCEPTION);
			standardData.setReturnMessage(CodeMsg.MSG_EXCEPTION);
		}
		return JsonUtils.toString(standardData, "yyyy-MM-dd HH:mm:ss");
	}

	/**
	 * 删除
	 * 
	 * @param httpRequest
	 * @param response
	 * @param ifm_id
	 * @return
	 */
	@ResponseBody
	@RequestMapping("deleteIformation")
	public String deleteIformation(HttpServletRequest httpRequest, HttpServletResponse response, Integer ifm_id,
			String ifm_name) {
		ReturnStandardDataFormat standardData = new ReturnStandardDataFormat(CodeMsg.CODE_ERROR, CodeMsg.MSG_ERROR,
				null);
		try {
			if (CommonUtils.isObjectNull(ifm_id)) {
				standardData.setReturnCode(CodeMsg.CODE_ERROR_PARAMS);
				standardData.setReturnMessage(CodeMsg.MSG_ERROR_PARAMS);
				return JsonUtils.toString(standardData, "yyyy-MM-dd HH:mm:ss");
			}
			if (iformationService.deleteByid(ifm_id)) {
				ActiveUser opuser = getUser(httpRequest);//获取操作用户
				OptRecord s = new OptClass().messfim_delete(opuser,Menu.ProgrammeManagement.toString(),
						Menu.Informationschemeconfiguration.toString(),Operation.delete.toString(),ifm_name);
				if(s.getOptName()!="null")
				ioptRecordService.insert(s);
				
				standardData.setReturnCode(CodeMsg.CODE_OK);
				standardData.setReturnMessage(CodeMsg.MSG_OK);
			} else {
				standardData.setReturnCode(CodeMsg.CODE_ERROR);
				standardData.setReturnMessage(CodeMsg.MSG_ERROR);
			}
		} catch (Exception e) {
			log.error("删除异常");
			ActiveUser opuser = getUser(httpRequest);//获取操作用户
			OptRecord s = new OptClass().recordabnormality(opuser,"方案信息配置删除异常");
			ioptRecordService.insert(s);
			standardData.setReturnCode(CodeMsg.CODE_EXCEPTION);
			standardData.setReturnMessage(CodeMsg.MSG_EXCEPTION);
		}
		return JsonUtils.toString(standardData, "yyyy-MM-dd HH:mm:ss");
	}

	/**
	 * 查询所有属于此组织的方案和未选组织的方案 组织模块接口
	 * 
	 * @param httpRequest
	 * @param response
	 * @param pageIndex
	 * @param pageSize
	 * @param ifm_name
	 * @param ifm_note
	 * @return
	 */
	@ResponseBody
	@RequestMapping("queryByParamsNN")
	public String queryByParamsNN(HttpServletRequest httpRequest, HttpServletResponse response, Integer pageIndex,
			Integer pageSize, String ifm_name, String ifm_note, String group_id) {
		List<Iformation> returnList = new ArrayList<Iformation>();
		ReturnStandardDataFormat standardData = new ReturnStandardDataFormat(CodeMsg.CODE_ERROR, CodeMsg.MSG_ERROR,
				returnList);
		PageView pageView = null;
		try {
			if (pageIndex == null || pageIndex <= 0) {
				pageIndex = 1;
			}
			if (pageSize == null || pageSize <= 0) {
				pageSize = 10;
			}
			pageView = new PageView(pageSize, pageIndex);
			// 中文转码
			if (null != ifm_name || "".equals(ifm_name)) {
				ifm_name = EncodingUtils.fixUrlParamEncoding(httpRequest, ifm_name);
			}
			if (null != ifm_note || "".equals(ifm_note)) {
				ifm_note = EncodingUtils.fixUrlParamEncoding(httpRequest, ifm_note);
			}
			int gid = Integer.parseInt(group_id);
			returnList = iformationService.queryByParamsNN(pageView, ifm_name, ifm_note, gid);
		} catch (Exception e) {
			log.error("根据参数查询发生异常");
			log.error(e.getMessage());
			standardData.setReturnCode(CodeMsg.CODE_EXCEPTION);
			standardData.setReturnMessage(CodeMsg.MSG_EXCEPTION);
			standardData.setReturnData(returnList);
		}
		standardData.setReturnData(returnList);
		standardData.setReturnCode(CodeMsg.CODE_OK);
		standardData.setReturnMessage(CodeMsg.MSG_OK);
		standardData.setTotalPages(pageView.getPageCount());
		standardData.setTotalRecords(pageView.getRowCount());
		return JsonUtils.toString(standardData, "yyyy-MM-dd HH:mm:ss");
	}

	/**
	 * 查询敏感信息
	 * 
	 * @param httpRequest
	 * @param response
	 * @param pageIndex
	 * @param pageSize
	 * @param ifm_name
	 * @param ifm_note
	 * @return
	 */
	@ResponseBody
	@RequestMapping("queryBymg")
	public String queryBymg(HttpServletRequest httpRequest, HttpServletResponse response, Integer pageIndex,
			Integer pageSize, String ifm_name, String ifm_note) {
		List<Iformation> returnList = new ArrayList<Iformation>();
		ReturnStandardDataFormat standardData = new ReturnStandardDataFormat(CodeMsg.CODE_ERROR, CodeMsg.MSG_ERROR,
				returnList);
		PageView pageView = null;
		try {
			if (pageIndex == null || pageIndex <= 0) {
				pageIndex = 1;
			}
			if (pageSize == null || pageSize <= 0) {
				pageSize = 10;
			}
			pageView = new PageView(pageSize, pageIndex);
			// 中文转码
			if (null != ifm_name || "".equals(ifm_name)) {
				ifm_name = EncodingUtils.fixUrlParamEncoding(httpRequest, ifm_name);
			}
			if (null != ifm_note || "".equals(ifm_note)) {
				ifm_note = EncodingUtils.fixUrlParamEncoding(httpRequest, ifm_note);
			}
			returnList = iformationService.queryBymg(pageView, ifm_name, ifm_note);
		} catch (Exception e) {
			log.error("根据参数查询发生异常");
			log.error(e.getMessage());
			standardData.setReturnCode(CodeMsg.CODE_EXCEPTION);
			standardData.setReturnMessage(CodeMsg.MSG_EXCEPTION);
			standardData.setReturnData(returnList);
		}
		standardData.setReturnData(returnList);
		standardData.setReturnCode(CodeMsg.CODE_OK);
		standardData.setReturnMessage(CodeMsg.MSG_OK);
		standardData.setTotalPages(pageView.getPageCount());
		standardData.setTotalRecords(pageView.getRowCount());
		return JsonUtils.toString(standardData, "yyyy-MM-dd HH:mm:ss");
	}
}
